package com.example.config;

import com.example.util.ApplicationContextUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TestConfig2 {


    @Autowired
    ApplicationContextUtil applicationContextUtil;


    @Bean
    void init2(){

        for (int i = 0; i < 4; i++) {
//            prototypeDemo.test();
            PrototypeDemo prototypeDemo=(PrototypeDemo)applicationContextUtil.getBean(PrototypeDemo.class);
            System.out.println(prototypeDemo.hashCode()+"===222222222===="+this.toString());
        }
    }
}
